String.prototype.substringPro = function(C, D) {
    var E = "";
    D = D || "...";
    if (this.getLen() <= C) {
        return this
    }
    for (var B = 0,
    A = 0; A < C - D.length;) {
        if (this.charCodeAt(B) >= 0 && this.charCodeAt(B) < 256) {
            E += this.charAt(B);
            A++
        } else {
            if ((A += 3) <= C) {
                E += this.charAt(B)
            }
        }
        B++
    }
    E += D;
    return E
};
String.prototype.getRootDomain = function() {
    var A = /^([^:]*:\/\/)?([^\/\.]+\.([^\/]+))/.exec(this);
    return A && A[3] !== undefined ? A[3] + "": ""
};
String.prototype.Trim = function() {
    return this.replace(/(^\s*)|(\s*$)/g, "")
};
String.prototype.getLen = function(B) {
    if ("undefined" == typeof B) {
        B = true
    } else {
        B = false
    }
    var A = 0;
    if (B) {
        for (var C = 0; C < this.length; ++C) {
            if (this.charCodeAt(C) > 127) {
                A += 3
            } else {
                A++
            }
        }
    } else {
        A = this.length
    }
    return A
};
String.prototype.chkLen = function(B, A) {
    var C = this.getLen(this);
    if (C > A || C < B) {
        return false
    } else {
        return true
    }
};
String.prototype.chkType = function(A) {
    switch (A) {
    case "int":
        return (/^-?[1-9][0-9]+$|^-?[0-9]$/).test(this);
    case "url":
        return (/^https?:\/\/([a-z0-9-]+\.)+[a-z0-9]{2,4}.*$/).test(this);
    case "email":
        return (/^[a-z0-9_+.-]+\@([a-z0-9-]+\.)+[a-z0-9]{2,4}$/i).test(this);
    case "idcard":
        return (/^[0-9]{15}$|^[0-9]{17}[a-zA-Z0-9]/).test(this);
    case "area":
        return (/^\d+(\.\d{1,2})?$/).test(this);
    case "money":
        return (/^\d+(\.\d{1,2})?$/).test(this);
    case "year":
        return (/^(19|20)\d\d$/).test(this);
    case "input":
        return (/^[\u4e00-\u9fa5A-Za-z0-9_\s\~\@\!\#\$\.\,\/\\\%\^\&\*\(\)_\+\?\>\<《〉》\:：〉、，。？！￥（）\{\}\[\]]+$/).test(this)
    }
    return false
};
String.prototype.containType = function(A) {
    switch (A) {
    case "mobile":
        return (/[0-9]{11}/).test(this)
    }
    return false
};
Array.prototype.unique = function() {
    var C = {};
    for (var B = 0,
    A = 0; B < this.length; B++) {
        if (this[B] !== undefined) {
            if (!C[this[B]]) {
                this[A++] = this[B];
                C[this[B]] = true
            }
        }
    }
    this.length = A;
    return this
};
Array.prototype.clone = function() {
    var A = [];
    for (var B in this) {
        if (A[B] === undefined && typeof this[B] == "string") {
            A[B] = this[B]
        }
    }
    return A
};
Array.prototype.insertAt = function(A, C) {
    var D = this.slice(0, A);
    var B = this.slice(A);
    D.push(C);
    return (D.concat(B))
};
window.openNew = function(C, A) {
    var B = document.createElement("form");
    form.action = C;
    form.target = A;
    form.submit()
};
window.getRadioValue = function(B) {
    var C = document.getElementsByName(B);
    var D = C.length;
    if (0 == D) {
        return null
    }
    for (var A = 0; A < D; ++A) {
        if (C[A].checked == true) {
            return C[A].value
        }
    }
    return ""
};
window.cancelBubble = function(A) {
    if (A && A.stopPropagation) {
        A.stopPropagation()
    } else {
        window.event.cancelBubble = true
    }
    return false
};
strip_tags = function(G, H) {
    var K = "",
    I = false;
    var F = [];
    var A = [];
    var J = "";
    var D = 0;
    var C = "";
    var E = "";
    var B = function(M, L, N) {
        return N.split(M).join(L)
    };
    if (H) {
        A = H.match(/([a-zA-Z0-9]+)/gi)
    }
    G += "";
    F = G.match(/(<\/?[\S][^>]*>)/gi);
    for (K in F) {
        if (isNaN(K)) {
            continue
        }
        E = F[K].toString();
        I = false;
        for (C in A) {
            J = A[C];
            D = -1;
            if (D != 0) {
                D = E.toLowerCase().indexOf("<" + J + ">")
            }
            if (D != 0) {
                D = E.toLowerCase().indexOf("<" + J + " ")
            }
            if (D != 0) {
                D = E.toLowerCase().indexOf("</" + J)
            }
            if (D == 0) {
                I = true;
                break
            }
        }
        if (!I) {
            G = B(E, "", G)
        }
    }
    return G
};
APF.Namespace.register("fangkewang.global.header");
fangkewang.global.header.CitySelector = Class.create({
    initialize: function(D, C, A) {
        this.selector = $(D);
        this.panelId = C;
        this.hideTimeout = A;
        var B = $(C);
        this.iframe = B.select("iframe").first();
        this.iframe.setStyle({
            width: B.getWidth() + "px",
            height: B.getHeight() + "px"
        });
        this.selector.observe("mouseover",
        function() {
            window.clearTimeout(this.timeoutHandle);
            $(this.panelId).show()
        }.bind(this));
        this.selector.observe("mouseout",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.timeoutHandle = window.setTimeout("$('" + this.panelId + "').hide()", this.hideTimeout)
        }.bind(this));
        B.observe("mouseover",
        function() {
            window.clearTimeout(this.timeoutHandle);
            $(this.panelId).show()
        }.bind(this));
        B.observe("mouseout",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.timeoutHandle = window.setTimeout("$('" + this.panelId + "').hide()", this.hideTimeout)
        }.bind(this));
        var E = this.selector.select("a").first();
        if (E != undefined) {
            E.observe("click",
            function(F) {
                F.preventDefault()
            })
        }
    }
});
APF.Namespace.register("fangkewang.global.search");
fangkewang.global.search.Autocompleter = Class.create(Ajax.Autocompleter, {
    initialize: function($super, C, D, B, A) {
        $super(C, D, B, A);
        this.index = -1;
        this.keyMove = false;
        this.kwLen = 100;
        this.curKw = "";
        this.input_kw = $(C);
        if (A.formid) {
            this.form_elem = $(A.formid);
            this.bindSubmitForm()
        }
        this._fixChineseInputMethodProblem()
    },
    _fixChineseInputMethodProblem: function() {
        var A = window.setInterval(function() {
            if (this.oldElementValue == this.element.value) {
                return
            }
            this.oldElementValue = this.element.value;
            if (this.observer) {
                clearTimeout(this.observer)
            }
            this.observer = setTimeout(this.onObserverEvent.bind(this), 0)
        }.bind(this), this.options.frequency * 1000)
    },
    selectEntry: function($super) {
        this.oldElementValue = this.element.value;
        if (this.observer) {
            clearTimeout(this.observer)
        }
        $super()
    },
    updateChoices: function($super, D) {
        if (!this.changed && this.hasFocus) {
            if (D == "" || D == "<ul></ul>") {
                this.entryCount = 0;
                this.curKw = ""
            } else {
                this.update.innerHTML = D;
                Element.cleanWhitespace(this.update);
                Element.cleanWhitespace(this.update.down());
                this.kwLen = 100;
                var C = this.strIsEnglish(this.input_kw.value);
                if (this.update.firstChild && this.update.down().childNodes) {
                    this.entryCount = this.update.down().childNodes.length;
                    for (var A = 0; A < this.entryCount; A++) {
                        var B = this.getEntry(A);
                        B.autocompleteIndex = A;
                        this.addObservers(B);
                        if (C) {
                            this.getKeywords(B.childNodes[0].innerHTML)
                        }
                    }
                } else {
                    this.entryCount = 0;
                    this.curKw = ""
                }
            }
            this.stopIndicator();
            this.index = -1;
            if (this.entryCount == 1 && this.options.autoSelect) {
                this.selectEntry();
                this.hide()
            } else {
                this.render()
            }
        }
    },
    onKeyPress: function(A) {
        if (this.observer) {
            clearTimeout(this.observer);
            this.observer = null
        }
        if (this.active) {
            switch (A.keyCode) {
            case Event.KEY_RETURN:
                if (this.index < 0) {
                    return
                }
                if (this.keyMove == false) {
                    return false
                }
                this.selectEntry();
                Event.stop(A);
            case Event.KEY_TAB:
            case Event.KEY_ESC:
                this.hide();
                this.active = false;
                Event.stop(A);
                return;
            case Event.KEY_LEFT:
            case Event.KEY_RIGHT:
                return;
            case Event.KEY_UP:
                this.markPrevious();
                this.render();
                Event.stop(A);
                this.keyMove = true;
                return;
            case Event.KEY_DOWN:
                this.markNext();
                this.render();
                Event.stop(A);
                this.keyMove = true;
                return
            }
        } else {
            if (A.keyCode == Event.KEY_TAB || A.keyCode == Event.KEY_RETURN || (Prototype.Browser.WebKit > 0 && A.keyCode == 0)) {
                return
            }
        }
        this.changed = true;
        this.hasFocus = true
    },
    show: function($super) {
        $super();
        this.update.setStyle({
            width: this.update.getWidth() - 2 + "px"
        })
    },
    markPrevious: function() {
        if (this.index > 0) {
            this.index--
        } else {
            this.index = this.entryCount - 1
        }
        this.getEntry(this.index).scrollIntoView(false)
    },
    getUpdatedChoices: function($super) {
        this.startIndicator();
        var B = encodeURIComponent(this.options.paramName) + "=" + encodeURIComponent(this.getToken());
        this.options.parameters = this.options.callback ? this.options.callback(this.element, B) : B;
        if (this.options.defaultParams) {
            this.options.parameters += "&" + this.options.defaultParams
        }
        var A = new Ajax.Request(this.url, this.options);
        this.requestingURL = A.url
    },
    onComplete: function(A) {
        this.updateChoices(A.responseText)
    },
    getKeywords: function(A) {
        var B = this.getStrLength(A);
        if (B < this.kwLen) {
            this.kwLen = B;
            this.curKw = A
        } else {
            if (B == this.kwLen && this.strIsEnglish(A)) {
                this.curKw = A
            }
        }
    },
    getStrLength: function(A) {
        return A.replace(/[^\x00-\xff]/g, "**").length
    },
    strIsEnglish: function(A) {
        return /^[A-Za-z ]+$/.test(A)
    },
    bindSubmitForm: function() {
        var A = this;
        A.form_elem.observe("submit",
        function() {
            var B = A.strIsEnglish(A.input_kw.value);
            if (B && A.curKw != "") {
                A.input_kw.value = A.curKw
            }
        })
    }
});
fangkewang.global.search.SearchSuggestion = Class.create({
    initialize: function(C, B, A) {
        this.options = A || {};
        this.element = $(C);
        this.update = this.options.update ? $(this.options.update) : this._createUpdateElement();
        this.url = B;
        this.useSuggestion = false;
        this.autocompleter = new fangkewang.global.search.Autocompleter(this.element, this.update, this.url, {
            method: "GET",
            frequency: 0.2,
            minChars: 1,
            formid: this.options.formid,
            afterUpdateElement: function(D, F) {
                D.value = this._removeTags(F.firstDescendant().innerHTML);
                var E = this._findParentForm(D);
                if (E) {
                    E.submit()
                }
            }.bind(this),
            callback: function(D, E) {
                if (!this.options.onParameters) {
                    return E
                }
                var F = this.options.onParameters(E);
                if (F && "function" == typeof(F.toQueryString)) {
                    return F.toQueryString()
                } else {
                    return F
                }
            }.bind(this)
        })
    },
    _findParentForm: function(A) {
        var B = A;
        while (B) {
            if (B.tagName == "FORM") {
                break
            }
            B = B.parentNode
        }
        return B
    },
    _createUpdateElement: function() {
        var A = $(document.createElement("div"));
        this.options.className = this.options.className || "SearchSuggestion";
        A.addClassName(this.options.className);
        var C = this._getInternetExplorerVersion();
        if (C > 0 && C <= 7) {
            var B = this.element.ancestors();
            Element.insert(B[0], {
                after: A
            })
        } else {
            Element.insert(document.body, {
                top: A
            })
        }
        return A
    },
    _getInternetExplorerVersion: function() {
        var C = -1;
        if (navigator.appName == "Microsoft Internet Explorer") {
            var A = navigator.userAgent;
            var B = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");
            if (B.exec(A) != null) {
                C = parseFloat(RegExp.$1)
            }
        }
        return C
    },
    _removeTags: function(A) {
        return A.replace(/\<em\>/g, "").replace(/\<\/em\>/g, "").replace(/\<EM\>/g, "").replace(/\<\/EM\>/g, "")
    }
});
APF.Namespace.register("fangkewang.global.header");
fangkewang.global.header.SearchBar = Class.create({
    initialize: function(A) {
        this.defaultSale = "请输入房源特征,地点或小区名...";
        this.defaultCommunity = "请输入小区名或路名...";
        this.defaultBroker = "请输入小区、路名、姓名、特长、所属公司...";
        this.defaultQuestion = "请输入您想要知道的房产相关内容...";
        this.searchForm = $(A.searchform);
        this.searchType = $(A.searchtype);
        this.searchkw = $(A.searchkw);
        this.searchbutton = $(A.searchbutton);
        this.searchingLable = this.searchForm.select(".select_cont").first();
        this.searchSelect = this.searchForm.select(".select_list").first();
        this.searchingLable.observe("click",
        function(B) {
            this.searchSelect.style.display = this.searchSelect.style.display == "none" ? "block": "none";
            Event.stop(B);
            document.observe("click",
            function() {
                this.searchSelect.style.display = "none"
            }.bind(this))
        }.bind(this));
        this.searchSelect.select("li").each(function(B) {
            B.observe("click",
            function() {
                var C = B.select("a").first();
                if (C) {
                    var D = C.innerHTML
                } else {
                    var D = B.innerHTML
                }
                this.searchingLable.select("a").first().innerHTML = D;
                this.searchType.value = B.getAttribute("rel");
                switch (this.searchType.value) {
                case "1":
                case "2":
                    this.searchkw.value = this.defaultSale;
                    this.searchbutton.className = "input_button se_house";
                    break;
                case "3":
                    this.searchkw.value = this.defaultCommunity;
                    this.searchbutton.className = "input_button se_community";
                    break;
                case "4":
                    this.searchkw.value = this.defaultBroker;
                    this.searchbutton.className = "input_button search";
                    break;
                case "8":
                    this.searchkw.value = this.defaultQuestion;
                    this.searchbutton.className = "input_button search";
                    break;
                default:
                    this.searchkw.value = this.defaultSale;
                    this.searchbutton.className = "input_button search"
                }
                Element.fire(document, "SearchBar:OptionList", this.searchType.value);
                this.searchSelect.select("li").each(function(F) {
                    var E = F.select("a").first();
                    if (E) {
                        tmptext = E.innerHTML
                    } else {
                        tmptext = F.innerHTML
                    }
                    if (F.getAttribute("rel") == this.searchType.value) {
                        F.update(tmptext)
                    } else {
                        F.update('<a href="javascript:;">' + tmptext + "</a>")
                    }
                    this.initSearchKeyword()
                }.bind(this))
            }.bind(this))
        }.bind(this));
        this.initSearchKeyword()
    },
    initSearchKeyword: function() {
        this.searchkw.stopObserving("focus");
        this.searchkw.stopObserving("blur");
        var A = this.searchType.value;
        if (A == 3) {
            var B = this.defaultCommunity
        } else {
            if (A == 4) {
                var B = this.defaultBroker
            } else {
                if (A == 8) {
                    var B = this.defaultQuestion
                } else {
                    var B = this.defaultSale
                }
            }
        }
        this.searchkw.observe("focus",
        function() {
            if (this.searchkw.value == B) {
                this.searchkw.value = "";
                this.searchkw.addClassName("focus")
            }
        }.bind(this));
        this.searchkw.observe("blur",
        function() {
            if (this.searchkw.value == "") {
                this.searchkw.value = B;
                this.searchkw.removeClassName("focus")
            }
        }.bind(this))
    }
});
function dw_add_link_from(A) {
    var G = /^http:\/\//;
    var B = document.getElementsByTagName("a");
    for (var F = 0; F < B.length; F++) {
        var H = B[F].getAttribute(A);
        if (H != null) {
            var E = B[F].href;
            if (!E.match(G)) {
                continue
            }
            if (E.indexOf("from=") != -1) {
                continue
            }
            H = encodeURIComponent(H);
            var D = E.split("#");
            if (E.indexOf("?") != -1) {
                E = D[0] + "&from=" + H
            } else {
                E = D[0] + "?from=" + H
            }
            if (D.length > 1) {
                for (var C = 1; C < D.length; C++) {
                    E += "#" + D[C]
                }
            }
            B[F].href = E
        }
    }
}
Event.observe(window, "load",
function() {
    dw_add_link_from("_soj")
});
APF.Namespace.register("fangkewang.global.topnav");
fangkewang.global.topnav = Class.create({
    initialize: function(A, B) {
        this.objMsgDiv = $(A);
        this.divfangkewang = $(B);
        this.intTimeout = 500;
        var D = function(J) {
            var F = J.responseJSON;
            if (0 == F.common.userid) {
                return
            }
            this.intUserType = F.common.usertype;
            var L = "您好，";
            if (1 == this.intUserType || 2 == this.intUserType || 3 == this.intUserType) {
                L += '<a href="' + F.lefturl.profileurl + '">' + F.common.usernamestr + "</a>"
            } else {
                L += F.common.usernamestr
            }
            L += '！ <a href="' + F.lefturl.pmurl + '" ' + F.common.msgstyle + ">" + F.common.msgcntstr + '</a>&nbsp;[&nbsp;<a href="' + F.lefturl.logouturl + '" class="ba">退出</a>&nbsp;]';
            this.objMsgDiv.innerHTML = L;
            this.divfangkewang.innerHTML = "";
            this.aSelector = document.createElement("a");
            this.aSelector.className = "ba";
            this.aSelector.href = F.righturl.myfangkewang;
            if (2 == this.intUserType || 3 == this.intUserType) {
                this.divfangkewang.className = "myfangkewang_b";
                var G = document.createElement("img");
                G.src = "http://pages.fangkewangstatic.com/img/icon/icon_brocker_14.gif";
                this.divfangkewang.appendChild(G);
                this.aSelector.innerHTML = "我的网络经纪人"
            } else {
                if (1 == this.intUserType) {
                    this.divfangkewang.className = "myfangkewang";
                    this.aSelector.innerHTML = "我的房客网"
                } else {
                    this.divfangkewang.className = "myfangkewang_store";
                    var G = document.createElement("img");
                    G.src = "http://pages.fangkewangstatic.com/img/icon/icon_brocker_14.gif";
                    this.divfangkewang.appendChild(G);
                    this.aSelector.innerHTML = "我的网络经纪人"
                }
            }
            this.divfangkewang.appendChild(this.aSelector);
            var K = F.righturl.links.length;
            if (0 < K) {
                var I = document.createElement("ul");
                I.className = "list_submenu";
                for (var H = 0; H < K; ++H) {
                    var E = document.createElement("li");
                    E.className = "liMenu";
                    E.innerHTML = '<a href="' + F.righturl.links[H][1] + '">' + F.righturl.links[H][0] + "</a>";
                    I.appendChild(E)
                }
                this.divfangkewang.appendChild(I)
            }
            this.divfangkewang.observe("mouseover",
            function() {
                window.clearTimeout(this.timeoutHandle);
                this.aSelector.className = "ba_s";
                if (2 == this.intUserType) {
                    this.divfangkewang.className = "myfangkewang_b_s"
                } else {
                    this.divfangkewang.className = "myfangkewang_s"
                }
            }.bind(this));
            this.divfangkewang.observe("mouseout",
            function() {
                window.clearTimeout(this.timeoutHandle);
                this.timeoutHandle = window.setTimeout(function() {
                    if (2 == this.intUserType) {
                        this.divfangkewang.className = "myfangkewang_b"
                    } else {
                        this.divfangkewang.className = "myfangkewang"
                    }
                    this.aSelector.className = "ba"
                }.bind(this), this.intTimeout)
            }.bind(this))
        };
        var C = {
            method: "get",
            onSuccess: D.bind(this)
        };
        new Ajax.Request("/ajax/checklogin/?r=" + Math.random(), C)
    }
});
fangkewang.global.topnav2 = Class.create({
    initialize: function(C, B, D, A, E) {
        this.divfangkewang = $(C);
        this.divList = $(B);
        this.aSelector = $(D);
        this.intTimeout = A;
        this.intUserType = E;
        this.arrLis = this.divList.getElementsByTagName("li");
        this.divfangkewang.observe("mouseover",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.aSelector.className = "ba_s";
            if (2 == this.intUserType) {
                this.divfangkewang.className = "myfangkewang_b_s"
            } else {
                this.divfangkewang.className = "myfangkewang_s"
            }
        }.bind(this));
        this.divfangkewang.observe("mouseout",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.timeoutHandle = window.setTimeout(function() {
                if (2 == this.intUserType) {
                    this.divfangkewang.className = "myfangkewang_b"
                } else {
                    this.divfangkewang.className = "myfangkewang"
                }
                this.aSelector.className = "ba"
            }.bind(this), this.intTimeout)
        }.bind(this))
    }
});
APF.Namespace.register("fangkewang.global.header");
fangkewang.global.header.LoginPanel = Class.create({
    initialize: function(A) {
        this.bolAjax = A.bolAjax;
        this.topLoginPanel = $(A.loginpanel);
        this.ProCondUrl = A.procondurl;
        this.ProCondButton = $(A.procondbutton);
        this.ProCondContainer = $(A.procondcontent);
        this.RightContainer = $(A.rightcontent);
        this.UserId = A.defuserid;
        this.UserType = A.defusertype;
        this.weitoAllow = A.weitoAllow;
        this.strBaseDomain = A.strBaseDomain;
        this.objPropConditions = null;
        this.loadingPropCondition = false;
        this.strIOSParams = A.strIOSParams;
        this.initLoginStatus()
    },
    initLoginStatus: function() {
        if (this.bolAjax == 1) {
            this.UserId = 0;
            this.UserType = 0;
            var A = {
                method: "get",
                onSuccess: function(B) {
                    var D = B.responseJSON;
                    if (D.common.userid > 0) {
                        this.UserId = D.common.userid;
                        this.UserType = D.common.usertype;
                        this.UserName = D.common.usernamestr;
                        this.UserMsgNum = D.common.msgcntstr;
                        this.UserMsgStyle = D.common.msgstyle;
                        this.lefturl = D.lefturl;
                        this.righturl = D.righturl;
                        if (this.UserType == 1) {
                            var C = this.buildMemberHtml()
                        } else {
                            if (this.UserType == 2) {
                                var C = this.buildBrokerHtml()
                            } else {
                                var C = this.buildBrokerCompanyHtml()
                            }
                        }
                        this.topLoginPanel.hide();
                        new Insertion.After(this.topLoginPanel, C);
                        this.topLoginPanel.remove();
                        this.initBrokerFloatMenu()
                    }
                }.bind(this)
            };
            new Ajax.Request("/ajax/checklogin/?r=" + Math.random(), A)
        } else {
            this.initBrokerFloatMenu()
        }
    },
    initBrokerFloatMenu: function() {
        if (this.UserType == 2) {
            var B = $("top_broker_panel").select(".broker_boxer").first();
            B.observe("mouseover",
            function() {
                $("broker_menu").show();
                B.select("a").first().addClassName("hover")
            }.bind(this));
            B.observe("mouseout",
            function() {
                $("broker_menu").hide();
                B.select("a").first().removeClassName("hover")
            }.bind(this))
        } else {
            if (this.UserType == 1) {
                try {
                    var D = $("toplogin_cont_userlogin").select(".username_boxer").first();
                    D.observe("mouseover",
                    function() {
                        $("user_info").show();
                        D.select("a").first().addClassName("hover")
                    }.bind(this));
                    var C = document.attachEvent ? "mouseleave": "mouseout";
                    D.observe(C,
                    function() {
                        $("user_info").hide();
                        D.select("a").first().removeClassName("hover")
                    }.bind(this))
                } catch(A) {}
            }
        }
    },
    initPropCondFloatMenu: function() {
        if (this.UserType > 1) {
            this.RightContainer.hide();
            return
        }
        this.actPropMoving = false;
        Event.observe(this.ProCondButton, "mouseover",
        function() {
            if (this.UserType == 1) {
                if (this.objPropConditions == null && this.loadingPropCondition == false) {
                    var options = {
                        method: "get",
                        parameters: {
                            act: "fetch",
                            r: Math.random()
                        },
                        onSuccess: function(transfer) {
                            this.loadingPropCondition = false;
                            this.objPropConditions = eval(transfer.responseText);
                            this.showPropCondition()
                        }.bind(this)
                    };
                    this.loadingPropCondition = true;
                    new Ajax.Request("/ajax/propcond", options)
                } else {
                    this.showPropCondition()
                }
            } else {
                this.showPropCondition()
            }
        }.bind(this));
        Event.observe(this.ProCondButton, "mouseout",
        function() {
            this.hidePropCondition()
        }.bind(this))
    },
    buildMemberHtml: function() {
        var A = "";
        A += '<ul class="toplogin_cont userlogin" id="toplogin_cont_userlogin">';
        if (this.strIOSParams != "") {
            A += '<li><a href="http://pages.fangkewang.com/app/fangkewang/ios.html' + this.strIOSParams + '">手机房客网</a></li>'
        } else {
            A += '<li><a href="http://pages.fangkewang.com/app/fangkewang/ios.html">手机房客网</a></li>'
        }
        if (this.weitoAllow) {
            A += '<li class="line">|</li>';
            A += '<li><a href="http://my.fangkewang.com/member/leadproperty" target="_blank" rel="nofollow">我要卖房</a></li>'
        }
        A += '<li class="line">|</li>';
        A += '<li><a class="emailbox" href="' + this.lefturl.pmurl + '" ' + this.UserMsgStyle + ">" + this.UserMsgNum + "</a></li>";
        A += '<li class="line">|</li>';
        A += '<li>&nbsp;<a style="color:#333" href="' + this.lefturl.logouturl + '">[退出]</a></li>';
        A += '<li class="username_boxer">';
        A += '<a href="' + this.lefturl.profileurl + '" class="username">您好，' + this.UserName + "</a>";
        A += '<ul class="user_info" id="user_info" style="display:none;">';
        A += '<li><a href="http://my.' + this.strBaseDomain + '/prop/collection?show=best">个性化推荐</a></li>';
        A += '<li><a href="http://my.' + this.strBaseDomain + '/marked/">选房单</a></li>';
        A += '<li><a href="http://my.' + this.strBaseDomain + '/community/concerned/">收藏的小区</a></li>';
        A += "</ul>";
        A += "</li>";
        A += "</ul>";
        return A
    },
    buildBrokerHtml: function() {
        var A = "";
        A += '<ul class="toplogin_cont" id="top_broker_panel">';
        A += '<li class="exit"><a href="' + this.lefturl.logouturl + '">退出</a></li>';
        A += '<li class="broker_boxer">';
        A += '<a href="' + this.righturl.myfangkewang + '" class="brokername">我的网络经纪人</a>';
        A += '<ul class="broker_info" id="broker_menu" style="display:none">';
        for (var B = 0; B < this.righturl.links.length; B++) {
            var C = this.righturl.links[B];
            A += '<li><a href="' + C[1] + '">' + C[0] + "</a></li>"
        }
        A += "</ul>";
        A += "</li>";
        A += '<li><a href="' + this.lefturl.pmurl + '" class="mail" ' + this.UserMsgStyle + ">" + this.UserMsgNum + "</a></li>";
        A += '<li><a href="' + this.lefturl.profileurl + '">' + this.UserName + "</a></li>";
        A += '<li><span class="welcome">您好，</span></li>';
        A += "</ul>";
        return A
    },
    buildBrokerCompanyHtml: function() {
        var A = "";
        A += '<ul class="toplogin_cont">';
        A += '<li class="exit"><a href="' + this.lefturl.logouturl + '">退出</a></li>';
        A += '<li><a href="' + this.righturl.myfangkewang + '">我的网络经纪人</a></li>';
        A += '<li><a href="' + this.lefturl.pmurl + '" class="mail" ' + this.UserMsgStyle + ">" + this.UserMsgNum + "</a></li>";
        A += "<li>" + this.UserName + "</li>";
        A += '<li><span class="welcome">您好，</span></li>';
        A += "</ul>";
        return A
    },
    showPropCondition: function() {
        var A = "";
        if (this.actPropMoving == false) {
            if (this.UserType == 1 && this.objPropConditions != null) {
                A += "<dt>最近保存的找房条件：</dt>";
                for (var B = 0; B < this.objPropConditions.length; B++) {
                    A += '<dd class="dd01"><a href="' + this.objPropConditions[B].UrlString + '" class="prolist">' + this.objPropConditions[B].SearchName + "</a></dd>"
                }
                A += '<dd class="dd02"><a href="' + this.ProCondUrl + '" class="more">更多&gt;&gt;</a></dd>'
            } else {
                A += "<dt>您还没有保存过找房条件</dt>";
                A += '<dd class="dd02"><a href="' + this.ProCondUrl + '" class="more">更多&gt;&gt;</a></dd>'
            }
            this.ProCondButton.select("a").first().addClassName("hover");
            this.ProCondContainer.update(A);
            this.actPropMoving = true;
            this.ProCondContainer.show()
        }
    },
    hidePropCondition: function() {
        this.actPropMoving = false;
        this.ProCondButton.select("a").first().removeClassName("hover");
        this.ProCondContainer.hide()
    }
});
APF.Namespace.register("fangkewang.global.footer");
fangkewang.global.footer.CityList = Class.create({
    initialize: function(C, B) {
        this.selector = $(C);
        this.panelId = B;
        var A = $(B);
        this.hideTimeout = 500;
        this.selector.observe("mouseover",
        function() {
            window.clearTimeout(this.timeoutHandle);
            $(this.panelId).show()
        }.bind(this));
        this.selector.observe("mouseout",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.timeoutHandle = window.setTimeout("$('" + this.panelId + "').hide()", this.hideTimeout)
        }.bind(this));
        A.observe("mouseover",
        function() {
            window.clearTimeout(this.timeoutHandle);
            $(this.panelId).show()
        }.bind(this));
        A.observe("mouseout",
        function() {
            window.clearTimeout(this.timeoutHandle);
            this.timeoutHandle = window.setTimeout("$('" + this.panelId + "').hide()", this.hideTimeout)
        }.bind(this));
        var D = this.selector.select("a").first();
        if (D != undefined) {
            D.observe("click",
            function(E) {
                E.preventDefault()
            })
        }
    }
});
var Global_Container_Dialog = Class.create({
    overlayElement: undefined,
    initialize: function(B, C) {
        B = $(B);
        this.dialogElement = B;
        if (typeof C != "undefined") {
            new Draggable(B, {
                handle: $(C)
            })
        }
        var A = this;
        Event.observe(window, "resize",
        function() {
            if (!Global_Container_Dialog.overlayElement) {
                return
            }
            Global_Container_Dialog.overlayElement.remove();
            Global_Container_Dialog.overlayElement = undefined;
            A.create_overaly()
        });
        Element.insert(document.body, B.remove())
    },
    center: function() {
        var E = this.dialogElement.getOffsetParent().cumulativeOffset();
        var B = this.getWindowSize();
        var A = this.getScroll();
        var D = A.left - E.left + (B.width - this.dialogElement.getWidth()) * 0.5;
        var C = A.top - E.top + (B.height - this.dialogElement.getHeight()) * 0.33;
        this.dialogElement.style.left = D + "px";
        this.dialogElement.style.top = C + "px"
    },
    show: function(B, A) {
        if (this.dialogElement.visible()) {
            return false
        }
        if (B) {
            this.create_overaly()
        }
        if (!A) {
            this.center()
        } else {
            this.dialogElement.style.left = A.left + "px";
            this.dialogElement.style.top = A.top + "px"
        }
        this.dialogElement.show();
        return true
    },
    hide: function() {
        if (!this.dialogElement.visible()) {
            return false
        }
        if (Global_Container_Dialog.overlayElement) {
            Global_Container_Dialog.overlayElement.remove();
            Global_Container_Dialog.overlayElement = undefined
        }
        this.dialogElement.hide();
        return true
    },
    create_overaly: function() {
        Global_Container_Dialog.overlayElement = $(document.createElement("div"));
        Global_Container_Dialog.overlayElement.addClassName("modal_overlay");
        Global_Container_Dialog.overlayElement.setOpacity(0.5);
        Global_Container_Dialog.overlayElement.style.width = document.documentElement.scrollWidth + "px";
        Global_Container_Dialog.overlayElement.style.height = document.documentElement.scrollHeight + "px";
        document.body.appendChild(Global_Container_Dialog.overlayElement)
    },
    getWindowSize: function() {
        var B = 0,
        A = 0;
        if (typeof(window.innerWidth) == "number") {
            B = window.innerWidth;
            A = window.innerHeight
        } else {
            if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
                B = document.documentElement.clientWidth;
                A = document.documentElement.clientHeight
            } else {
                if (document.body && (document.body.clientWidth || document.body.clientHeight)) {
                    B = document.body.clientWidth;
                    A = document.body.clientHeight
                }
            }
        }
        return {
            width: B,
            height: A
        }
    },
    getScroll: function() {
        var B = 0,
        A = 0;
        if (typeof(window.pageYOffset) == "number") {
            A = window.pageYOffset;
            B = window.pageXOffset
        } else {
            if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
                A = document.body.scrollTop;
                B = document.body.scrollLeft
            } else {
                if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
                    A = document.documentElement.scrollTop;
                    B = document.documentElement.scrollLeft
                }
            }
        }
        return {
            left: B,
            top: A
        }
    }
});
APF.Namespace.register("fangkewang.home.home4");
fangkewang.home.home4 = Class.create({
    initialize: function(A) {
        this.defaultKeyword = "请输入房源特征,地点或小区名...";
        this.defaultUser = "用户名或者email";
        this.searchType = 1;
        this.cityid = A.cityid;
        this.kwElement = A.kw;
        this.formElement = A.form;
        this.suggestionUrl = A.suggesturl;
        this.recommendUrl = A.recommendurl;
        this.history = A.history;
        this.initKeywordText();
        this.initKeywordAutoComplete();
        this.initLoginBox();
        this.initRecommendProps();
        this.initHotCommunity();
        this.intLastSearchKeywords()
    },
    initKeywordText: function() {
        element = $(this.kwElement);
        element.observe("click",
        function() {
            if (element.value == this.defaultKeyword) {
                element.value = "";
                element.addClassName("typing")
            }
        }.bind(this));
        element.observe("blur",
        function() {
            if (element.value == "") {
                element.value = this.defaultKeyword;
                element.removeClassName("typing")
            }
        }.bind(this))
    },
    initKeywordAutoComplete: function() {
        var B = this.cityid;
        var A = this.searchType;
        new fangkewang.global.search.SearchSuggestion(this.kwElement, this.suggestionUrl, {
            onParameters: function(C) {
                var D = C.toQueryParams();
                if (A) {
                    D.c = B;
                    D.t = A;
                    D.vr = 1
                }
                return Object.toQueryString(D)
            },
            formid: this.formElement
        })
    },
    initLoginBox: function() {
        var A = {
            method: "get",
            onSuccess: function(G) {
                var C = G.responseJSON;
                var H = $("divWaitLogin");
                var D = $("login_boxer");
                var F = D.select(".nologin").first();
                H.style.display = "none";
                this.showMobileConfirm(C.common.ismobile);
                if (0 == C.common.userid) {
                    if (C.lastuser == "") {
                        $("username").value = "用户名或者email";
                        $("username").className = "input_text_2"
                    } else {
                        if ($("username")) {
                            $("username").value = C.lastuser;
                            $("username").className = "input_text"
                        }
                        $("username").value = C.lastuser;
                        $("username").className = "input_text"
                    }
                    return
                }
                F.remove();
                if (C.common.usertype == 1) {
                    var E = this.buildMemberLogin(C);
                    D.update(E)
                } else {
                    var B = this.buildBrokerLogin(C);
                    D.update(B)
                }
            }.bind(this)
        };
        new Ajax.Request("/ajax/checklogin/?position=1&history=" + this.history + "&r=" + Math.random(), A)
    },
    initRecommendProps: function() {
        var A = {
            method: "get",
            onSuccess: function(D) {
                data = D.responseJSON;
                if (data.VIEWED.length > 0) {
                    var E = $("RecommendProp");
                    var F = this.build_recommend_html(data.RECOMMEND);
                    E.select(".list").first().remove();
                    new Insertion.After(E.select("h3").first(), F);
                    var C = $("historyContainer");
                    var H = this.build_history_html(data.VIEWED);
                    C.select(".no_list").first().remove();
                    new Insertion.After(C.select("h3").first(), H)
                }
                if (data.RELCOMM.length > 0) {
                    var B = $("interestCommunity");
                    var G = this.build_interest_community_html(data.RELCOMM);
                    B.select(".list").first().remove();
                    new Insertion.After(B.select("h3").first(), G)
                }
            }.bind(this)
        };
        new Ajax.Request(this.recommendUrl, A)
    },
    initHotCommunity: function() {
        var A = $("hotcomm_boxer").select(".tab_bar").first();
        A.select("li").each(function(B) {
            B.observe("mouseover",
            function() {
                relIndex = B.getAttribute("rel");
                if (relIndex != null) {
                    A.select("span").each(function(C) {
                        C.removeClassName("tab_on")
                    });
                    A.select("a").each(function(C) {
                        C.removeClassName("tab_on")
                    });
                    myspan = B.select("span").first();
                    mylink = B.select("a").first();
                    if (myspan) {
                        myspan.addClassName("tab_on")
                    }
                    if (mylink) {
                        mylink.addClassName("tab_on")
                    }
                    if (relIndex) {
                        $("hotcomm_boxer").select(".hotcomm_list").each(function(C) {
                            C.hide()
                        });
                        $("area_comm_" + relIndex).show()
                    }
                }
            })
        })
    },
    build_history_html: function(C) {
        var A = "";
        A += '<ul class="historylist" id="historylist">';
        for (var B = 0; B < C.length; B++) {
            A += '<li><a href="' + C[B].LINK + '" target="_blank"><span class="title">' + this.cutstr(C[B].COMMNAME, 7, "...") + "</span>，" + C[B].AREANUM + '平，<span class="price">' + C[B].PROPRICE + "万</span></a></li>"
        }
        if (C.length >= 4) {
            A += '<li class="more"><a href="/prop/viewed/" target="_blank">更多&nbsp;»</a></li>'
        }
        A += "</ul>";
        return A
    },
    build_recommend_html: function(C) {
        var A = "";
        A += '<ul class="list">';
        for (var B = 0; B < C.length; B++) {
            A += "<li>";
            A += '<a href="' + C[B].LINK + '" class="image" target="_blank"><img src="' + C[B].IMAGESRC + '" width="100" height="75" /></a>';
            A += '<span class="sale_tag"></span>';
            A += '<p class="propinfo">';
            A += '<a href="' + C[B].LINK + '" target="_blank">' + C[B].AREANAME + " - " + C[B].COMMNAME + "<br>" + C[B].ROOMNUM + "室" + C[B].HALLNUM + "厅， " + C[B].AREANUM + "平米</a>";
            A += "</p>";
            A += '<p class="price">' + C[B].PROPRICE + "万元</p>";
            A += "</li>"
        }
        A += "</ul>";
        return A
    },
    build_interest_community_html: function(D) {
        var A = "";
        A += '<ul class="list">';
        for (var B = 0; B < D.length; B++) {
            if (D[B].MIDCHANGE.replace("%", "") < 0) {
                var C = ' class="down"'
            } else {
                var C = ' class="up"'
            }
            A += "<li>";
            A += '<a href="' + D[B].VIEWLINK + '" class="image" target="_blank"><img src="' + D[B].IMGSRC + '" width="100" height="75" /></a>';
            A += '<p class="comm_title"><a href="' + D[B].VIEWLINK + '" target="_blank">' + D[B].COMMNAME + "</a></p>";
            A += '<p class="price"><strong>' + D[B].MIDPRICE + "</strong>&nbsp;<span " + C + ">" + D[B].MIDCHANGE + "</span></p>";
            A += '<p><a href="' + D[B].PRICELINK + '" target="_blank">查房价</a>-<a href="' + D[B].PROPLINK + '" target="_blank">看房源</a></p>';
            A += "</li>"
        }
        A += "</ul>";
        return A
    },
    buildBrokerLogin: function(D) {
        var A = "";
        A += '<div class="broker_login">';
        A += "<h3>我的房客网</h3>";
        var C = "";
        if (D.common.usertype == 2) {
            C = ' class="brokerlist"'
        }
        A += "<ul" + C + ">";
        for (var B = 0; B < D.url.length; B++) {
            if (D.url[B][2] != "") {
                listClass = ' class="' + D.url[B][2] + '"'
            } else {
                listClass = ""
            }
            A += "<li" + listClass + '><a href="' + D.url[B][1] + '" target="_blank">' + D.url[B][0] + "</a></li>"
        }
        A += "</ul>";
        A += "</div>";
        return A
    },
    buildMemberLogin: function(B) {
        var A = "";
        A += '<div class="user_login">';
        A += '<div class="top_link">';
        A += '<a href="' + this.getUrl(B.url, "my") + '" target="_blank">我的房客网</a> | ';
        A += '<a href="' + this.getUrl(B.url, "probill") + '" target="_blank">选房单</a> | ';
        A += '<a href="' + this.getUrl(B.url, "profactor") + '" target="_blank">找房条件</a>';
        A += "</div>";
        A += '<dl class="user_dl01">';
        A += "<dt>房源太多，找起来太累？</dt>";
        A += '<dd><a href="http://my.fangkewang.com/prop/collection?show=best" target="_blank">查看个性化推荐房源>></a></dd>';
        A += '<dd class="image_links"><a href="http://my.fangkewang.com/prop/collection?show=best" target="_blank">&nbsp;</a></dd>';
        A += "</dl>";
        if (B.common.showcommission == 1) {
            A += '<dl class="user_dl02">';
            A += "<dt>我是房东：</dt>";
            A += '<dd><a href="' + this.getUrl(B.url, "commission_sale") + '" target="_blank">有房出售</a>，<a href="' + this.getUrl(B.url, "commission_rent") + '" target="_blank">有房出租</a>>></dd>';
            A += '<dd class="image_links"><a href="' + this.getUrl(B.url, "commission_sale") + '" target="_blank">&nbsp;</a></dd>';
            A += "</dl>"
        } else {
            A += '<dl class="user_dl03">';
            A += "<dt>您收藏了<em>" + B.common.markednum + "</em>套房源</dt>";
            A += '<dd><a href="' + this.getUrl(B.url, "probill") + '" target="_blank">管理我收藏的房源>></a></dd>';
            A += '<dd class="image_links"><a href="' + this.getUrl(B.url, "probill") + '" target="_blank">&nbsp;</a></dd>';
            A += "</dl>"
        }
        A += "</div>";
        return A
    },
    getUrl: